<include file="Public/min-header"/>
<div class="wrapper">
 <include file="Public/breadcrumb"/>
 <style>#search-form > .form-group{margin-left: 10px;}</style>
  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 教练列表</h3>
        </div>
        <div class="panel-body">
          <div class="navbar navbar-default">
              <form action="" id="search-form2" class="navbar-form form-inline" method="post" >
                <div class="form-group">
                  <select name="is_open" id="is_open" class="form-control">
                    <!--<option value="">选择分类</option>-->
                    <option  <if condition="2 eq $is_open">selected="selected"</if> value="2">教练 </option>
                    <option  <if condition="1 eq $is_open">selected="selected"</if> value="1"> 其他员工</option>
                  </select>
                </div>


                <div class="form-group">
                  <label class="control-label" for="input-order-id"> </label>
                  <div class="input-group">
                    <input type="text" name="key_word" value="{$key_word}" placeholder="输入真实姓名搜索" id="input-order-id" class="form-control">
                  </div>
                </div>                  
                <!--排序规则-->
                <button type="submit"   class="btn btn-primary"><i class="fa fa-search"></i> 筛选</button>
                <button type="button" onclick="location.href='{:U('Admin/Coach/addEditCoach')}'" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加新教练</button>
              </form>
          </div>
            <div class="box-body">
                <div class="row">
                    <div class="col-sm-12">
                        <table id="list-table" class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
                            <thead>
                            <tr role="row">
                                <th valign="middle">分类ID</th>
                                <th valign="middle">姓名</th>
                                <th valign="middle">头像</th>
                                <th valign="middle">电话</th>
                                <th valign="middle">教练类别</th>
                                <th valign="middle">教练等级</th>
                                <th valign="middle">禁用/启用</th>
                                <th valign="middle">可预约</th>
                                <th valign="middle">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="coach_list" item="vo" key="k" >


                                <tr role="row" align="left" class="{$vo.level}" id="{$vo.level}_{$vo.id}" <if condition="$vo[level] gt 1">style="display:none"</if>>
                                <td>{$vo.id}</td>
                                <td align="left" style="padding-left:<?php echo ($vo[level] * 5); ?>em">
                                    <span>{$vo.name} </span>
                                </td>
                                <td>
                                   <php> if($vo[images]){</php>
                                    <img src="{$vo.images}" style="height:50px;">
                                    <php>}else{</php>
                                    <img src="{$vo.user_id|get_user_head}" style="height:50px;">
                                    <php>}</php>
                                </td>
                                <td>
                                    <span>{$vo.tel} </span>
                                </td>
                                <td>
                                    <!--<span>{$vo.cate_id|get_coach_cate_name} </span>-->



                                    <span>
                                          <if condition="$vo[cate_id] gt 0">
                                           {$vo.cate_id|get_coach_cate_name}
                                        </if>
                                        <!--{$vo.cate_id|get_coach_grade}-->
                                    </span>
                                    <span>
                                        <if condition="$vo[cate_id2] gt 0">
                                          /  {$vo.cate_id2|get_coach_cate_name}
                                        </if>
                                    </span>
                                    <span>
                                          <if condition="$vo[cate_id3] gt 0">
                                           /  {$vo.cate_id3|get_coach_cate_name}
                                        </if>
                                        <!--{$vo.cate_id3|get_coach_grade}-->
                                    </span>





                                </td>
                                <td>
                                    <span>{$vo.grade_id|get_coach_grade} </span>
                                </td>
                                <td>
                                    <php>if($vo[status]==1){</php>
                                    <a    class="btn btn-primary" href="{:U('Coach/cut_status',array('id'=>$vo['id'],'status'=>$vo['status']))}">禁用</a>
                                    <php>}else{</php>
                                    <a   class="btn  btn-danger" href="{:U('Coach/cut_status',array('id'=>$vo['id'],'status'=>$vo['status']))}">启用</a>
                                    <php>}</php>
                                </td>


                                <td>
                                    <php>if($vo[is_open]==1){</php>
                                    <a    class="btn btn-primary" href="{:U('Coach/cut_status',array('id'=>$vo['id'],'is_open'=>$vo['is_open']))}">禁用</a>
                                    <php>}else{</php>
                                    <a   class="btn  btn-danger" href="{:U('Coach/cut_status',array('id'=>$vo['id'],'is_open'=>$vo['is_open']))}">启用</a>
                                    <php>}</php>
                                </td>


                                <td>
                                    <!--<button class="btn btn-primary"  onclick="edit_time({$vo.id})"> 修改</button>-->
                                    <a  title="编辑" class="btn btn-primary" href="{:U('Coach/addEditCoach',array('id'=>$vo['id']))}"><i class="fa fa-pencil"></i></a>
                                    <a   title="删除" class="btn btn-danger" href="javascript:del_fun('{:U('Coach/coachDelete',array('id'=>$vo['id']))}');"><i class="fa fa-trash-o"></i></a>

                                </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                        <div class="row">
                            <div class="col-sm-3 text-left"></div>
                            <div class="col-sm-9 text-right">{$page}</div>
                        </div>
                    </div>
                </div>

            </div><!-- /.box-body -->
          <!--<div id="ajax_return"> </div>-->
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
<script>



</script> 
</body>
</html>